package com.firstcare.android_dylibrary.bean;

import com.alibaba.fastjson.JSONObject;
import com.firstcare.android_dylibrary.DYApplication;
import com.firstcare.android_dylibrary.bean.base.BaseModelProxy;
import com.firstcare.android_dylibrary.network.URLSet;
import com.firstcare.android_dylibrary.network.request.ModelListRequest;
import com.rdxer.xxlibrary.HTTPUtils.listener.ErrorListener;
import com.rdxer.xxlibrary.HTTPUtils.listener.FailedListener;
import com.rdxer.xxlibrary.HTTPUtils.listener.OKListener;
import java.util.List;
/**
 * Created by chenyichao on 2016/8/10.
 */
public class CurveProxy extends BaseModelProxy<Curve> {
    /**
     *  不使用缓存
     */
    public static void getCurveProxyListNoCache(String type,String time,final OKListener<List<CurveProxy>> okListener, FailedListener failedListener, ErrorListener errorListener) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("type",type);
        jsonObject.put("createTime",time);
        ModelListRequest<CurveProxy> request = new ModelListRequest<CurveProxy>(URLSet.getCurveData, jsonObject, okListener, failedListener, errorListener) {
            @Override
            protected Object getTargetData(JSONObject response) throws Exception {
                return response.getJSONObject("data").getJSONArray("hashMapList");
            }
        };

        DYApplication.getShared().getApi().addToRequestQueue(request);
    }
}
